package com.hotline.communication.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum RecordTypeEnum {

    //录音类型 1 座席录音   2 自动留言 3 外呼录音，4，外呼会场录音，不存储通迅表记录,5，定义为转外线全程录音,6，企业志愿者热线

    SEAT_RECORD(1,"座席录音"),

    AUTO_RECORD(2,"自动留言"),

    CALL_OUT_RECORD(3,"外呼录音"),

    TRANSFER_RECORD(4,"呼转录音");

//    CALL_OUT_MEETING_RECORD(4,"外呼会场录音"),
//
//    TRANSFER_TOTAL_RECORD(5,"转外线全程录音"),
//
//    ENTERPRISE_VOLUNTEER_HOTLINE(6,"企业志愿者热线");

    /**
     * 编码
     */
    private Integer code;

    /**
     * 名称
     */
    private String name;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }



    RecordTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static RecordTypeEnum getRecordTypeEnum(Integer code){
        for (RecordTypeEnum recordTypeEnum : RecordTypeEnum.values()){
            if(recordTypeEnum.getCode().equals(code)){
                return recordTypeEnum;
            }
        }
        return null;
    }

    public static List getRecordTypeEnumList(){
        List list = new ArrayList();
        for (RecordTypeEnum recordTypeEnum : RecordTypeEnum.values()){
            Map map = new HashMap<>();
            map.put("code",recordTypeEnum.getCode());
            map.put("name",recordTypeEnum.getName());
            list.add(map);
        }
        return list;
    }

}
